<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<jsp:include page="/WEB-INF/template/cabecalho.jsp"/>  
<style>
	#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
	#sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
	#sortable li span { position: absolute; margin-left: -1.3em; }
	</style>
<%
Integer i = 0; 
String execJS = "";
%>
<p>
Dist&acirc;ncia total do percurso: ${fleetEngineOutput.result.dist} <br/>
Tempo total do percurso: ${fleetEngineOutput.result.drivetime} <br/>
</p>
<c:forEach items="${fleetEngineOutput.resourceperiods}" var="rp" varStatus="s">
 <fieldset>
	<ul>
		<li><h4>In&iacute;cio Per&iacute;odo: ${rp.startdepot.starttime}</h4></li>
 		<li><h4>Final Per&iacute;odo: ${rp.stopdepot.starttime}</h4></li>
		<li>
		<ul id="sortable_<%=++i%>">
			<c:forEach items="${rp.jobs}" var="job" varStatus="s">
				<c:if test="${job.resource!=''}">
				<li class="ui-state-default">
					Ponto de Entrega: ${job.id} <br/>
					Recurso usado: ${job.resource} <br/>
				<!-- 	Entregue:
					<c:forEach items="${job.loads}" var="load" varStatus="s">
						${load.load} <br/>
					</c:forEach>-->
				</li>
				</c:if>
			</c:forEach>
		</ul>
		</li>		
<%
	execJS +="$('#sortable_" + i + "' ).sortable();	$( '#sortable_" + i + "' ).disableSelection();";
%>
</c:forEach>


<script>
	$(function() {
		$('#mnuResultados').addClass('ativo');
		<%= execJS %>
	});
</script>
<jsp:include page="/WEB-INF/template/rodape.jsp"/>